<div class="panel panel-default">
    <div class="panel-heading"> 
        <h3 class="panel-title">
            <span>Lista wydatków </span>
            <span id="expense-sum-title">Suma:</span>
            <span id="expense-sum-box">{{ amount }}</span>
        </h3>
    </div>
    <div class="panel-body"> 
        <table id="list"></table> 
        <div id="pager"></div>
    </div>
</div>

<div class="panel panel-default">
    <div class="panel-heading"> 
        <h3 class="panel-title">
            Planowane wydatki
            <button class="btn btn-primary btn-xs" data-toggle="modal" data-target="#boxAddPlannedExpense">Dodaj nowy</button>
            <button class="btn btn-success btn-xs" id="copyPlannedExpense">Kopiuj z poprzedniego miesiąca</button>
        </h3>
    </div>
    <div class="panel-body"> 
        <table id="list_planned_expenses"></table> 
    </div>
</div>

<div class="modal fade" id="boxAddPlannedExpense" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
        <h4 class="modal-title" id="myModalLabel">Zaplanuj wydatek</h4>
      </div>
      {{ form_start(form_expense_planned, {'action': path('BudgetBudgetBundle_planned_expenses_new'), 'method': 'POST', 'attr' : {'id' : 'plannedExpenseForm'}}) }}
        <div class="modal-body">     
            {{ form_errors(form_expense_planned) }} 
            <div class="form-group">
              {{ form_row(form_expense_planned.name) }}
            </div>  
            <div class="form-group">
              {{ form_row(form_expense_planned.amount) }}
            </div>
            <div class="form-group small-input-expense">
              {{ form_row(form_expense_planned.category) }}
            </div>
            <div class="form-group small-input-expense">
              {{ form_row(form_expense_planned.date_expired) }}
            </div> 
            {{ form_rest(form_expense_planned) }}
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Zamknij</button>
          <button type="submit" class="btn btn-primary" id="addPlannedExpense">Zapisz</button>
        </div>
      {{ form_end(form_expense_planned) }}
    </div>
  </div>
</div>